Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse the url when creating a Link object #6635

Merged
merged 3 commits into from
Jun 24, 2019

Conversation

cjerdonek
Copy link
Member

@cjerdonek cjerdonek commented Jun 22, 2019

This is a small refactor affecting the Link class that does a few things:

  1. Changes the Link class to parse the url once when the Link is first created,
  2. Moves Link's unit tests to a separate test_link.py file,
  3. Adds more complete tests of Link.filename, and
  4. Fixes an edge case where Link.filename can leak auth information.

This is a preliminary refactor before addressing the security issue mentioned in this comment: #6418 (comment)

@cjerdonek cjerdonek added skip news Does not need a NEWS file entry (eg: trivial changes) type: refactor Refactoring code labels Jun 22, 2019
@cjerdonek cjerdonek force-pushed the link-parsed-attribute branch 2 times, most recently from aec36ce to eb1407b Compare June 22, 2019 23:22
@cjerdonek cjerdonek force-pushed the link-parsed-attribute branch from eb1407b to 0ed518f Compare June 22, 2019 23:45
@cjerdonek
Copy link
Member Author

@pradyunsg or @xavfernandez Could either of you take a glance at this? Thanks!

@pradyunsg
Copy link
Member

LGTM. Didn't go through the tests but I'm guessing they didn't change.

@cjerdonek
Copy link
Member Author

Thanks. And yep, just added additional ones.

@cjerdonek cjerdonek merged commit bfa976f into pypa:master Jun 24, 2019
@cjerdonek cjerdonek deleted the link-parsed-attribute branch June 24, 2019 05:39
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jul 24, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jul 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation skip news Does not need a NEWS file entry (eg: trivial changes) type: refactor Refactoring code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants